<?php

use Illuminate\Database\Seeder;

class ActivitySeeder extends Seeder
{
    /**
     * Run the database seeds.
     *
     * @return void
     */
    public function run()
    {
        $products = \App\Models\Product::with('skus')
            ->take(10)
            ->get();
        foreach ($products as $product) {
            \App\Models\Activity::create([
                'title'=> '限量',
                'product_id'=> $product->id,
                'type'=> 1,
                'quantity'=> 1000,
                'start_time'=> \Carbon\Carbon::now()->subDays(1),
                'end_time'=> \Carbon\Carbon::now()->addDays(2),
                'status'=> 0
            ]);

        }
    }
}
